package com.zhangdi.demo.solr.response;

/**
 * Created by zhangdi on 2020/06/29 16:10:19.
 */
public class ResponseUtils {
    public static Response success() {
        return new Response();
    }

    public static <T> Response<T> success(T data) {
        Response<T> response = new Response<>();
        response.setData(data);
        return response;
    }

    public static Response error() {
        Response response = new Response();
        response.setCode(500);
        return response;
    }

    public static Response error(String msg) {
        Response response = new Response();
        response.setCode(500);
        response.setMsg(msg);
        return response;
    }
}
